﻿// -----------------------------------------------------------------------
// <copyright file="CompressorFactory.cs">
// Copyright (c) 2013 Andrey Veselov. All rights reserved.
// License:  Microsoft Public License (MS-PL)
// Contacts: http://andrey.moveax.com  andrey@moveax.com
// </copyright>
// -----------------------------------------------------------------------

namespace PortableImagingLibrary.Png.Compressors
{
    using System;

    internal static class CompressorFactory
    {
        public static IDecompressor CreateDecompressor(CompressionType compressionType)
        {
            switch (compressionType) {
                case CompressionType.Deflate:
                    return new DeflateDecompressor();

                default:
                    throw new ArgumentOutOfRangeException("compressionType");
            }
        }

        public static ICompressor CreateCompressor(CompressionType compressionType)
        {
            switch (compressionType) {
                case CompressionType.Deflate:
                    return new DeflateCompressor();

                default:
                    throw new ArgumentOutOfRangeException("compressionType");
            }
        }
    }
}
